<?

$login_area = build_login_links();

function build_login_links() {
$loggedInGuest='';
$admin = '';
  if (session::is_admin()) {
    $admin = "<a href=\"index.php?admin\">Admin</a> | ";
  }
    if (isset($_SESSION['guest']) && $_SESSION['guest'] == 1) {
    $loggedInGuest='Guest';
  }

  
  ob_start();
  
  echo "
  <center>
   
        <table style=\"width: 250px\">
          <tr>
            <td style=\"width: 146px\">
          Welcome,         
          <?if($loggedInGuest == ''):?>
            <?echo $login?>
          <?endif;?>
          <?if($loggedInGuest == 'Guest'):?>
            <?echo $loggedInGuest?>
          <?endif;?>

!</td>
          <td class=\"style8\">
          (<?echo $admin?> <a href=\"index.php?logout\">Logout</a>)</td>
        </tr>
      </table>


      </center>
      ";
      
      $login_area=ob_get_contents();
      ob_end_clean();
      return $login_area;
}

?>